__author__ = 'mars'
import xml.etree.ElementTree as ElementTree

def getactivations(s):
    filetree = ElementTree.fromstring(s)
    return filetree.getiterator('activation')

def getmodel(activation):
    return activation.find('model').text

# Given an activation record (XML Element), return the account number
def getaccount(activation):
    return activation.find('account-number').text



#print f2
f3=f2=open("F:/activations/2008-10.xml",'r').read()
#print f3


f4=getactivations(f3)

print f4

for r4 in f4:
    print getaccount(r4) + ":" + getmodel(r4)


